#include <bits/stdc++.h>
#define int long long
using namespace std;

constexpr int N = 10000;
int prime[N];
int g[N];

signed main(int argc, char const *argv[])
{
    long long n;
    cin >> n;
    int ptr = 0;
    int cnt = 0;
    //cout << sqrt(n) << endl;
    for(long long i = 2;i*i<=n;i++){
        if(n % i == 0){
            cnt++;
            while(n % i == 0){
                prime[cnt] = i;
                g[cnt]++;
                n /= i;
            }
        }
    }
    if(n > 1){
        cnt++;
        prime[cnt] = n;
        g[cnt]++;
    }
    /* for(int i = 1;i<=cnt;i++){
        cout << prime[i] << " ";
    } */
    long long ans = 1;
    for(int i = 1;i<=cnt;i++){
        if(g[i] % 2 == 1){
            ans *= prime[i];
        }
    }
    cout << ans;
    return 0;
}
